package br.usp.poli.coop8.magapkg;

import java.io.Serializable;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

@Entity
public class Lista implements Serializable {
	@Id
	private int idlista;

	private int numinscritos;

	@ManyToOne
	@JoinColumns({
		@JoinColumn(name="IDPUBLICACAO", referencedColumnName="IDPUBLICACAO"),
		@JoinColumn(name="DATAEXEMPLAR", referencedColumnName="DATAEXEMPLAR")
	})
	private Publicacao publicacao;

	@OneToMany(mappedBy="idlista")
	private Set<Posicao> posicaoCollection;

	private static final long serialVersionUID = 1L;

	public Lista() {
		super();
	}

	public int getIdlista() {
		return this.idlista;
	}

	public void setIdlista(int idlista) {
		this.idlista = idlista;
	}

	public int getNuminscritos() {
		return this.numinscritos;
	}

	public void setNuminscritos(int numinscritos) {
		this.numinscritos = numinscritos;
	}

	public Publicacao getPublicacao() {
		return this.publicacao;
	}

	public void setPublicacao(Publicacao publicacao) {
		this.publicacao = publicacao;
	}

	public Set<Posicao> getPosicaoCollection() {
		return this.posicaoCollection;
	}

	public void setPosicaoCollection(Set<Posicao> posicaoCollection) {
		this.posicaoCollection = posicaoCollection;
	}

}
